//获取应用实例
var app = getApp()
var util = require('../../../utils/util.js')

Page({

  /**
   * 页面的初始数据
   */
  data: {

  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    this.selectPayStatus();
  },
  // 查询支付状态
  selectPayStatus(){
    let customer_id = wx.getStorageSync('customer_id')
    var that = this;
    wx.request({
      url: app.globalData.urls + '/order/check-pay',
      header: app.getRequestHeader(),
      method:"POST",
      data: {
        customer_id:customer_id.customer_id
      },
      success: function (res) {
        if(res.data.code==200){
          let data = res.data.data;
          var customer_id = wx.getStorageSync('customer_id');
          customer_id.bdmin_user_id = data.store_id
          wx.setStorageSync('shareId', data.store_id)
          wx.setStorageSync('customer_id', customer_id)
          that.setData(data)
        }
      }
    })
  },
  // 去选择
  goSelect(){
    wx.navigateTo({
      url: '/pages/business/open-shop/open-shop?store_id='+this.data.store_id,
    })
  },
})